import request from '@/utils/request'
let serviceName="/goods-service"

/**
 * 获取分页数据
 * @param { } keyword 
 */
export function getGoodses(keyword) {
    return request({ url: serviceName+ "/goods/list", method: "post", data: keyword });
}
/**
 * 更新
 * @param {*} id 
 */
export function update(goods){
    return  request({ url: serviceName+"/goods/update", method: "post",data: goods});
}
/**
 * 删除
 * @param {*} id 
 */
export function remove(id){
    return  request({ url: serviceName+"/goods/delete", method: "post",params:{"id":id}});
}
/**
 * 根据ID获取
 * @param {*} id 
 */
export function getGoods(id){
    return  request({ url: serviceName+"/goods/getById", method: "get",params:{"id":id}});
}
/**
 * 添加
 * @param {*} goods
 */
export function insert(goods) {
    return request({ url: serviceName+"/goods/insert", method: "post", data: goods });
}
/**
 * 上传图片
 */
export function setImage(file){
    return request({
    url:serviceName+"/goods/setImage",
    method:"post",
    data:file})
}